-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement tsp namespace for http-client-csharp #5443
Implement tsp namespace for http-client-csharp #5443
Conversation
fb24e3a
to
4e7b1e3
Compare
API change check APIView has identified API level changes in this PR and created following API reviews. Microsoft.Generator.CSharp.Input |
…e segment is the same as a client
packages/http-client-csharp/emitter/src/lib/client-model-builder.ts
Outdated
Show resolved
Hide resolved
packages/http-client-csharp/emitter/src/lib/client-model-builder.ts
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
f1709bc
to
a544bef
Compare
Nevermind - the tspconfig override only needs to be supported in the Azure plugin - not for unbranded. |
…t remove it otherwise it has pretty big impact on azure libraries
Please file the follow up issue to remove |
After the tsp namespace feature implementation in #5443, the namespace of model, enum and modelFactory have been changed from previous `XXX.Models` to `XXX`. For Azure plugin, we would like the namespace for model and enum to be `XXX.Models`. - Expose public setter of namespace, use visitor to update namespace of TypeProvider in Azure plugin. https://github.com/Azure/azure-sdk-for-net/pull/48197/files#diff-a6219e0492ffcf33fd4bb03be26f1e6bc04a84ee1e2723b4d58d5adbcdb031ef - Expose provider types to let sub-plugin identify. - Remove duplicated instance of ModelFactoryProvider - Remove Namespace property from CSharp
Fixes microsoft#5442 Fixes microsoft#5471 Fixes microsoft#5563 Fixes Azure/azure-sdk-for-net#47670 This PR contains the following: 1. now we honor the namespace defined in typespec for both model and clients (short for "namespace is namespace" feature) 2. <del>removes the `namespace` configuration from the emitter because we no longer need it. Azure generator still needs this, we will add it back in azure emitter (temporary until azure generator decides how to deal with it)</del> 3. removes the `use-model-namespace` configuration from the emitter because we no longer need it. Azure generator still needs this, we will add it back in azure emitter (temporary until azure generator decides how to deal with it) 4. reports diagnostic when there are conflicts between namespace segments and subclient names. Because this change changes the namespace of literally everything, there are quite a few file changed. Majority of them are the generated files changed for the namespace. We also have a piece of logic that automatically renames the client `Models` to `ModelsOps` in our emitter. We should not have it in the emitter any way. This part is removed. Azure part needs it, therefore we will add the same logic back in azure generator. Update: I have to add the configuration `namespace` back because `autorest.csharp` is still strongly coupled with this configuration, removing it causes massive changes on that side. Therefore I decided that we keep it here for now, we still write its value to configuration.json for backward compatibility, but MGC will not read it nor use it.
After the tsp namespace feature implementation in microsoft#5443, the namespace of model, enum and modelFactory have been changed from previous `XXX.Models` to `XXX`. For Azure plugin, we would like the namespace for model and enum to be `XXX.Models`. - Expose public setter of namespace, use visitor to update namespace of TypeProvider in Azure plugin. https://github.com/Azure/azure-sdk-for-net/pull/48197/files#diff-a6219e0492ffcf33fd4bb03be26f1e6bc04a84ee1e2723b4d58d5adbcdb031ef - Expose provider types to let sub-plugin identify. - Remove duplicated instance of ModelFactoryProvider - Remove Namespace property from CSharp
Fixes #5442
Fixes #5471
Fixes #5563
Fixes Azure/azure-sdk-for-net#47670
This PR contains the following:
removes thenamespace
configuration from the emitter because we no longer need it. Azure generator still needs this, we will add it back in azure emitter (temporary until azure generator decides how to deal with it)use-model-namespace
configuration from the emitter because we no longer need it. Azure generator still needs this, we will add it back in azure emitter (temporary until azure generator decides how to deal with it)Because this change changes the namespace of literally everything, there are quite a few file changed. Majority of them are the generated files changed for the namespace.
We also have a piece of logic that automatically renames the client
Models
toModelsOps
in our emitter. We should not have it in the emitter any way. This part is removed. Azure part needs it, therefore we will add the same logic back in azure generator.Update:
I have to add the configuration
namespace
back becauseautorest.csharp
is still strongly coupled with this configuration, removing it causes massive changes on that side. Therefore I decided that we keep it here for now, we still write its value to configuration.json for backward compatibility, but MGC will not read it nor use it.